﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="coupon_edit.aspx.cs" Inherits="MxWeiXinPF.Web.shopmgr.coupon.coupon_edit"  ValidateRequest="false"%>


<%@ Import Namespace="MxWeiXinPF.Common" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <title>编辑优惠券</title>
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="../../scripts/lhgdialog/lhgdialog.js?skin=idialog"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/kindeditor-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
    <script type="text/javascript" src="../../scripts/datepicker/WdatePicker.js"></script>
    <script type='text/javascript' src="../../scripts/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="../../scripts/swfupload/swfupload.handlers.js"></script>
    <script type="text/javascript" src="../../admin/js/layout.js"></script>
    <script type="text/javascript" src="../../admin/js/pinyin.js"></script>
    <link href="../../admin/skin/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../../admin/skin/mystyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();

            $("#btnVarAdd").click(function () {
                varHtml = createVarHtml();
                $("#tr_box").append(varHtml);

            });

            //初始化上传控件
            $(".upload-img").each(function () {
                $(this).InitSWFUpload({ sendurl: "../../tools/upload_ajax.ashx", flashurl: "../../scripts/swfupload/swfupload.swf" });
            });


            $("#btnSelectCouponCanUseIco").click(function () {
                selectico("imgCouponCanUseIco", "txtimgCouponCanUseIco");
            });
            $("#btnSelectCouponExpireICO").click(function () {
                selectico("imgCouponExpireIco", "txtCouponExpireIndexICO");
            });
            $("#btnSelectCouponUsedICO").click(function () {
                selectico("imgCouponUsedIco", "txtImgCouponUsedICO");
            });

            $("#btnSelectCouponCanUseImg").click(function () {
                selectico("imgCouponCanUseUrl", "txtImgCouponCanUseUrl");
            });
            $("#btnSelectCouponExpireImg").click(function () {
                selectico("imgCouponExpireIndexUrl", "txtCouponExpireIndexUrl");
            });
            $("#btnSelectCouponUsedImg").click(function () {
                selectico("imgCouponUsedUrl", "txtCouponUsedImgUrl");
            });
        });

        function selectico(imgControlId, txtUrlControlId) {
            $.dialog({
                id: 'selectIco',
                fixed: true,
                lock: true,
                max: false,
                min: false,
                title: "选择图片",
                content: "url:/admin/picmgr/picSelect.aspx?img=" + imgControlId + "&txt=" + txtUrlControlId,
                height: 420,
                width: 750
            });

        }
        function change2cn(en, cninput) {
            cninput.value = getSpell(en, "");
        }

    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="coupon_list.aspx" class="back"><i></i><span>返回优惠券列表</span></a>
            <i class="arrow"></i>
            <span>编辑优惠券</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div class="content-tab-wrap" >
            <div id="floatHead" class="content-tab" >
                <div class="content-tab-ul-wrap" >
                    <ul>
                        <li><a href="javascript:;" onclick="tabs(this);" class="selected">编辑优惠券</a></li>                     
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">             
             <dl>
                <dt>优惠券名称</dt>
                <dd>
                    <asp:TextBox ID="txtTitle" runat="server" onBlur="change2cn(this.value, this.form.txtCallIndex)" CssClass="input normal" datatype="*1-100" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*分类中文名称，100字符内</span></dd>
            </dl>
            <dl>
                <dt>面值</dt>
                <dd>
                    <asp:TextBox ID="tx_money" runat="server" onBlur="change2cn(this.value, this.form.txtCallIndex)" CssClass="input normal" datatype="*1-100" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*请填写数字</span></dd>
            </dl>
            <dl>
                <dt>有效期</dt>
                <dd>
                    <asp:TextBox ID="txtValidity" runat="server" CssClass="input date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-%d'})"/>
                </dd>
            </dl>
           <dl>
            <dt>是否启用</dt>
            <dd>
                <div class="rule-multi-radio">
                    <asp:RadioButtonList ID="rdbIsActive" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Text="是" Value="1"></asp:ListItem>
                        <asp:ListItem Text="否" Value="0" Selected="True"></asp:ListItem>
                    </asp:RadioButtonList>
                </div>
                <span>选是则是启用，选否则不启用</span>
            </dd>
        </dl>          
            <dl>
                <dt>优惠券可使用时图片</dt>
                <dd>
                    <div class="wxico_container" id="imgCouponCanUseIco_Container" style="background-color:white;"> 
                      <asp:Image ID="imgCouponCanUseIco" runat="server"  CssClass="imgico"  ImageUrl="~/images/noneimg.jpg" />
                        <asp:Literal ID="litimgCouponCanUseIco" runat="server"></asp:Literal>   
                     </div>     
                    <asp:TextBox ID="txtimgCouponCanUseIco" runat="server" CssClass="input normal"  ReadOnly="true"></asp:TextBox>
                    <input id="btnSelectCouponCanUseIco" type="button" value="选择" class="btn" />
                    <span class="Validform_checktip"> </span>
                </dd>
            </dl>
             <dl style="display:none;">
                <dt>优惠券可使用时图片</dt>
                <dd>
                     <asp:Image ID="imgCouponCanUseUrl" runat="server" style=" max-height:80px; background-color:#A0B4DC;" ImageUrl="~/images/noneimg.jpg" /><br />
                    <asp:TextBox ID="txtImgCouponCanUseUrl" runat="server" CssClass="input normal"   />
                     <input id="btnSelectCouponCanUseImg" type="button" value="选择" class="btn" />
                     <span class="Validform_checktip">推荐宽300高300像素正方形图片，个别模版需要宽720高400像素图片</span>

                </dd>
            </dl>
            <dl>
                <dt>优惠券过期图片</dt>
                <dd>
                    <div class="wxico_container" id="imgCouponExpireIco_Container" style="background-color:white;"> 
                      <asp:Image ID="imgCouponExpireIco" runat="server"  CssClass="imgico"  ImageUrl="~/images/noneimg.jpg" />
                        <asp:Literal ID="litCouponExpireIco" runat="server"></asp:Literal>   
                     </div>     
                    <asp:TextBox ID="txtCouponExpireIndexICO" runat="server" CssClass="input normal"  ReadOnly="true"></asp:TextBox>
                    <input id="btnSelectCouponExpireICO" type="button" value="选择" class="btn" />
                    <span class="Validform_checktip"> </span>
                </dd>
            </dl>
             <dl style="display:none;">
                <dt>优惠券过期图片</dt>
                <dd>
                     <asp:Image ID="imgCouponExpireIndexUrl" runat="server" style=" max-height:80px; background-color:#A0B4DC;" ImageUrl="~/images/noneimg.jpg" /><br />
                    <asp:TextBox ID="txtCouponExpireIndexUrl" runat="server" CssClass="input normal"   />
                     <input id="btnSelectCouponExpireImg" type="button" value="选择" class="btn" />
                     <span class="Validform_checktip">推荐宽300高300像素正方形图片，个别模版需要宽720高400像素图片</span>
                </dd>
            </dl> 
            <dl>
                <dt>优惠券已使用图片</dt>
                <dd>
                    <div class="wxico_container" id="imgCouponUsedContainer" style="background-color:white;"> 
                      <asp:Image ID="imgCouponUsedIco" runat="server"  CssClass="imgico"  ImageUrl="~/images/noneimg.jpg" />
                        <asp:Literal ID="litImgCouponUsedIco" runat="server"></asp:Literal>   
                     </div>     
                    <asp:TextBox ID="txtImgCouponUsedICO" runat="server" CssClass="input normal"  ReadOnly="true"></asp:TextBox>
                    <input id="btnSelectCouponUsedICO" type="button" value="选择" class="btn" />
                    <span class="Validform_checktip"> </span>
                </dd>
            </dl>
             <dl style="display:none;">
                <dt>优惠券已使用图片</dt>
                <dd>
                     <asp:Image ID="imgCouponUsedUrl" runat="server" style=" max-height:80px; background-color:#A0B4DC;" ImageUrl="~/images/noneimg.jpg" /><br />
                    <asp:TextBox ID="txtCouponUsedImgUrl" runat="server" CssClass="input normal"   />
                     <input id="btnSelectCouponUsedImg" type="button" value="选择" class="btn" />
                     <span class="Validform_checktip">推荐宽300高300像素正方形图片，个别模版需要宽720高400像素图片</span>

                </dd>
            </dl>                      
            <dl>
                <dt>优惠券介绍</dt>
                <dd>
                    <asp:TextBox ID="txtContent" runat="server" MaxLength="255" CssClass="input normal"  TextMode="MultiLine" />
                   
                </dd>
            </dl>                             
        </div>

        <!--/内容-->


        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-list">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
            <div class="clear"></div>
        </div>
        <!--/工具栏-->

    </form>
</body>
</html>
